import request from '@/cfsheep/request';

const CfCarParkUtil = {

  // 关键字模糊快速搜索停车场
  cfCarParkSearch: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getListByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 停车场统计报表
  getDailyParkingStatistcsListByQuery: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getDailyParkingStatistcsListByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 拉取停车记录
  getCarParkUseLogListByQuery: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getCarParkUseLogListByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 拉取车辆类型
  getCarTypeListByQuery: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getCarTypeListByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 获取指定停车记录图片
  getCarParkUseLogImages: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getCarParkUseLogImages',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  //获取停车场详情
  getCarParkInfoById: (data) => {
    return request({
      url: '/internetOfThings/cfCarPark/getCarParkInfoById',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  //更新车场信息
  updateCarPark: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/update',
      method: 'PUT',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '操作中',
        successMsg: '操作成功',
      },
      header: {
        'Content-type': 'application/json;charset=UTF-8',
      }
    });
  },

  // 拉取停车套餐
  getCarParkPackageListByQuery: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getCarParkPackageListByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 拉取停车产品
  getCarParkPackageProductListByQuery: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getCarParkPackageProductListByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  //添加停车套餐
  addCarParkPackage: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/addCarParkPackage',
      method: 'POST',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '操作中',
        successMsg: '操作成功',
      },
      header: {
        'Content-type': 'application/json;charset=UTF-8',
      }
    });
  },

  // 删除停车套餐
  deleteCarParkPackage: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/deleteCarParkPackage',
      method: 'DELETE',
      params: data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 拉取开闸记录
  getReleaseLogListByQuery: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getReleaseLogListByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 拉取开闸记录统计
  getReleaseLogCountsByQuery: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getReleaseLogCountsByQuery',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

  // 获取指定停车记录车主手机号
  getCarParkUseLogDriverPhone: (data) => {
    return request({
      url: '/internetOfThingsAdmin/cfCarPark/getCarParkUseLogDriverPhone',
      method: 'GET',
      data ,
      custom: {
        showSuccess: true,
        loadingMsg: '搜索中',
        successMsg: '搜索成功',
      },
    });
  },

};

export default CfCarParkUtil;
